package libs

import (
	"fmt"
	"github.com/go-redis/redis"
)

func NewRedisConn(config *Redis) *redis.Client {
	addr := fmt.Sprintf("%s:%d", config.Host, config.Port)
	client := redis.NewClient(&redis.Options{
		Addr:     addr,
		Password: config.Password, // no password set
		DB:       config.DB,       // use default DB
	})
	return client
}
